package cn.iocoder.yudao.hires.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.hires.entity.ResumeWorkDO;
import cn.iocoder.yudao.hires.vo.ResumeWorkPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 简历-工作经历 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ResumeWorkMapper extends BaseMapperX<ResumeWorkDO> {

    default PageResult<ResumeWorkDO> selectPage(ResumeWorkPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResumeWorkDO>()
                .eqIfPresent(ResumeWorkDO::getUserId, reqVO.getUserId())
                .likeIfPresent(ResumeWorkDO::getOrgName, reqVO.getOrgName())
                .eqIfPresent(ResumeWorkDO::getOffice, reqVO.getOffice())
                .betweenIfPresent(ResumeWorkDO::getOnboardingTime, reqVO.getOnboardingTime())
                .betweenIfPresent(ResumeWorkDO::getSeparationTime, reqVO.getSeparationTime())
                .eqIfPresent(ResumeWorkDO::getJobDescription, reqVO.getJobDescription())
                .betweenIfPresent(ResumeWorkDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ResumeWorkDO::getId));
    }

}